//去重并按顺序打印
public class Test {
    public static String func(String str){
        StringBuilder stringBuilder=new StringBuilder();
        for(int i=0;i<str.length();i++){
            char ch=str.charAt(i);
            if(stringBuilder.indexOf(ch+"")==-1){
                stringBuilder.append(ch);
            }
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        System.out.println(func("aaaxxDD"));
    }
}
